<%@ page import="com.site.entity.ConfigEntity" %>
<%@ page import="java.lang.reflect.Type" %>
<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:useBean id="service" class="com.site.service.ConfigService" scope="page" />
<%
  ConfigEntity entity=service.getSiteConfig();
  List<NewsEntity> list=new NewsService().getIndexTitle();
  List<NewTypeEntity> Typelist=new NewTypeService().getAll();
  List<CaseEntity> caselist=new CaseService().getAll();
%>

<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title><%=entity.getTitle()%></title>
  <link rel="stylesheet" href="CSS/common.css">
  <link rel="stylesheet" href="CSS/Index-header.css">
  <link rel="icon" href="<%=entity.getPageIcon()%>">
  <base target="_top">
</head>

<body>
<!-- 引入头部 -->
<div id="header"><%@include file="header.jsp"%></div>

<!-- 轮播图主体 -->
<div class="swipe" id="swipe">
  <!-- 模糊背景 -->
  <div class="bg" id="swipe_bg"></div>
  <!-- 图片区域 -->
  <div class="w1200">
    <!-- 图片显示 -->
    <div class="img-box" id="swipe_img_box">
      <a href="#" class="link" id="swipe_link">
        <img src="" alt="" class="img" id="swipe_img">
      </a>
    </div>
    <!-- 指示点 -->
    <div class="select" id="swipe_select">
    </div>
    <!-- 左侧翻页按钮 -->
    <div class="btn left" id="swipe_btn_left">
      &lt;
    </div>
    <!-- 右侧翻页按钮 -->
    <div class="btn right" id="swipe_btn_right">
      &gt;
    </div>
  </div>
</div>

<!-- 建站优势 -->
<div class="w1200 lel">
  <h1>建站优势</h1>
  <h2>Advantage of Construction Station</h2>
  <img src="Images/Index/lev.png" alt="" srcset="" class="lel_img">
</div>

<!-- 核心业务
Core Business -->
<div class="w1200 lel">
  <h1>核心业务</h1>
  <h2>Core Business</h2>
  <img src="Images/Index/loginc.png" alt="" srcset="">
</div>

<div class="w1200 lel">
  <h1>建站流程
  </h1>
  <h2>Station Building Process</h2>
  <img src="Images/Index/flow.png" alt="" srcset="">
</div>


<!-- 案例 -->
<div class="product_list lel">
  <h1>案例欣赏</h1>
  <h2>Case&nbsp;Appreciation</h2>
  <ul>
    <%
      for(CaseEntity Case:caselist){
    %>
    <li>
      <a href="Case Admire.jsp">
        <img src=<%=Case.getBgImg()%> alt="">
        <div>
          <h2>
<%--            这是标题--%>
            <%=Case.getTitle()%>
          </h2>
<%--          Lorem ipsum dolor sit, amet consectetur adipisicing elit. Sint, libero quam. Explicabo, dolorem--%>
<%--          soluta assumenda quo eaque at obcaecati inventore provident labore natus earum aliquam dolorum--%>
<%--          perferendis necessitatibus corrupti alias!--%>
          <%=Case.getRemark()%>
        </div>
      </a>
    </li>
    <%
      }
    %>
  </ul>
</div>

<!--新闻中心-->
<h1 class="title-center">新闻中心<br/><span>News&nbsp;Center</span></h1>
<div class="w1200 lel gao news">

  <%
    for(NewTypeEntity type:Typelist){
  %>
  <div class="news_list">
    <h3>
<%--      行业新闻--%>
      <%=type.getTitle()%>
    </h3>
    <p><%=type.getTitleEn()%></p>
    <%
      for(NewsEntity cont:list){
    %>
    <div>
      <div class="left_time">
        <p><%=cont.getPushTime().getDate()%></p>
        <span>
<%--          2018-02--%>
          <%=cont.getPushTime()%>
        </span>
        <p class="bg"></p>
      </div>
      <h4><p><%=cont.getTitle()%></p>
        <span>
<%--          这是一个标题--%>
          <%=cont.getContent()%>
        </span>
      </h4>
    </div>
    <%
      }
    %>

    <a href="PressCenter.jsp">查看更多</a>
  </div>
  <%
    }
  %>
</div>

<!-- 引入底部 -->
<div id="footer"><%@include file="footer.jsp"%></div>
<script src="JS/autoPlay.js"></script>
</div>
</body>

</html>
<script>
  // window.addEventListener('load',(e)=>{
  //   let a=new Date();
  //   document.getElementById("title-year").innerText=a.getFullYear();
  // });
</script>